-- Path of Building
--
-- Strength support gems
-- Skill data (c) Grinding Gear Games
--
local skills, mod, flag, skill = ...

#skill SupportAddedFireDamage
#mods

#skill SupportAddedFireDamagePlus
#mods

#skill SupportSpiritStrike
	statMap = {
		["support_spirit_strike_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
	},
#mods

#skill SupportAncestralCallPlus
	statMap = {
		["support_spirit_strike_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
	},
#mods

#skill SupportBehead
	statMap = {
		["support_executioner_damage_vs_enemies_on_low_life_+%_final"] = {
			mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Hit, KeywordFlag.Ailment), { type = "ActorCondition", actor = "enemy", var = "LowLife" })
		},
	},
#mods

#skill SupportBloodMagic
#mods

#skill SupportBloodthirst
	statMap = {
		["support_blood_thirst_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
		["blood_price_gain_%_maximum_life_as_added_physical_damage_with_weapons_while_on_low_life"] = {
			mod("PhysicalMin", "BASE", nil, ModFlag.Weapon, 0, { type = "PercentStat", stat = "Life", percent = 1 }, { type = "Condition", var = "LowLife"}),
			mod("PhysicalMax", "BASE", nil, ModFlag.Weapon, 0, { type = "PercentStat", stat = "Life", percent = 1 }, { type = "Condition", var = "LowLife"}),
		},
	},
#mods

#skill SupportBloodlust
	statMap = {
		["support_bloodlust_melee_physical_damage_+%_final_vs_bleeding_enemies"] = {
			mod("PhysicalDamage", "MORE", nil, ModFlag.Melee, 0, { type = "ActorCondition", actor = "enemy", var = "Bleeding" }),
		},
	},
#mods

#skill SupportBrutality
	statMap = {
		["support_brutality_physical_damage_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil),
		},
	},
#mods

#skill SupportBrutalityPlus
	statMap = {
		["support_brutality_physical_damage_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil),
		},
	},
#mods

#skill SupportIncreasedBurningDamage
	statMap = {
		["support_burning_damage_+%_final"] = {
			mod("FireDamage", "MORE", nil, 0, KeywordFlag.FireDot),
		},
	},
#mods

#skill SupportBurningDamagePlus
	statMap = {
		["support_burning_damage_+%_final"] = {
			mod("FireDamage", "MORE", nil, 0, KeywordFlag.FireDot),
		},
	},
#mods

#skill CallToArms
#mods

#skill SupportCallToArms
#mods

#skill SupportCastOnMeleeKill
	statMap = {
		["support_cast_on_melee_kill_spell_damage_+%_final"] = {
		},
	},
#mods

#skill SupportCastOnMeleeKillTriggered
	statMap = {
		["support_cast_on_melee_kill_spell_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Spell),
		},
	},
#mods

#skill SupportCastOnDamageTaken
	statMap = {
		["cast_on_damage_taken_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
		["cast_when_damage_taken_trigger_threshold_+%"] = {
			mod("CWDTThreshold", "MORE", nil)
		}
	},
#mods

#skill SupportChanceToBleed
	statMap = {
		["support_chance_to_bleed_bleeding_damage_+%_final"] = {
			mod("Damage", "MORE", nil, 0, KeywordFlag.Bleed),
		},
	},
#mods

#skill SupportColdToFire
#mods

#skill SupportControlledBlaze
	statMap = {
		["support_recent_ignites_ignite_damage_per_recent_ignite_+%_final"] = {
			mod("Damage", "MORE", nil, 0, KeywordFlag.Ignite, { type = "Multiplier", var = "IgniteAppliedRecently", limitVar = "ControlledBlazeRecentIgniteLimitMax", limitTotal = true }),
		},
		["support_recent_ignites_damage_per_recent_ignite_+%_final"] = {
			mod("Damage", "MORE", nil, 0, 0, { type = "Multiplier", var = "IgniteAppliedRecently", limitVar = "ControlledBlazeRecentIgniteLimitMin", limitNegTotal = true }),
		},
		["support_recent_ignites_ignite_damage_per_recent_ignite_+%_final_maximum"] = {
			mod("Multiplier:ControlledBlazeRecentIgniteLimitMax", "BASE", nil),
		},
		["support_recent_ignites_damage_per_recent_ignite_+%_final_minimum"] = {
			mod("Multiplier:ControlledBlazeRecentIgniteLimitMin", "BASE", nil),
		},
	},
#mods

#skill SupportCorruptingCry
	statMap = {
		["support_corrupting_cry_corrupted_blood_base_physical_damage_to_deal_per_minute"] = {
			skill("PhysicalDot", nil),
			div = 60,
		},
		["support_corrupting_cry_warcry_applies_X_stacks_of_corrupted_blood"] = {
			mod("CorruptingCryStagesFromWarcry", nil, 0, KeywordFlag.Warcry)
		},
		["support_corrupting_cry_exerted_attack_applies_X_stacks_of_corrupted_blood_on_first_hit"] = {
			mod("CorruptingCryStagesFromExerted", nil, 0, KeywordFlag.Attack)
		},
		["support_corrupting_cry_area_of_effect_+%_final"] = {
			mod("AreaOfEffect", "INC", nil, 0, KeywordFlag.Warcry)
		},
		["support_corrupting_cry_warcry_and_first_exerted_attack_applies_corrupted_blood_for_X_ms"] = {
			skill("durationSecondary", nil),
			div = 1000,
		}
	},
#baseMod skill("debuff", true)
#baseMod flag("dotIsCorruptingBlood")
#baseMod mod("Multiplier:CorruptingCryMaxStages", "BASE", 10)
#baseMod mod("Damage", "MORE", 100, 0, KeywordFlag.PhysicalDot, { type = "Multiplier", var = "CorruptingCryStageAfterFirst"})
#mods

#skill SupportCruelty
	statMap = {
		["support_cruelty_hit_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Hit),
		},
		["hits_grant_cruelty"] = {
			mod("Damage", "MORE", 1, ModFlag.Dot, 0, { type = "Multiplier", var = "Cruelty" }),
		},
	},
#baseMod flag("Cruelty")
#mods

#skill SupportMeleeDamageOnFullLife
	statMap = {
		["support_damage_while_on_full_life_+%_final"] = {
			mod("Damage", "MORE", nil, 0, 0, { type = "Condition", var = "FullLife" }),
		},
	},
#mods

#skill SupportAuraDuration
	statMap = {
		["support_aura_duration_base_buff_duration"] = {
			skill("auraDuration", nil),
			div = 1000,
		},
	},
#mods

#skill SupportEarthbreaker
	addFlags = {
		totem = true,
	},
	statMap = {
		["support_ancestor_slam_totem_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, ModFlag.Attack),
		},
		["support_ancestor_slam_totem_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
		["ancestor_totem_grants_owner_area_of_effect_+%_with_melee_skills"] = {
			mod("AreaOfEffect", "INC", nil, ModFlag.Melee),
		},
	},
#mods

#skill SupportWeaponElementalDamage
	statMap = {
		["support_attack_skills_elemental_damage_+%_final"] = {
			mod("ElementalDamage", "MORE", nil, 0, KeywordFlag.Attack),
		},
	},
#mods

#skill SupportWeaponElementalDamagePlus
	statMap = {
		["support_attack_skills_elemental_damage_+%_final"] = {
			mod("ElementalDamage", "MORE", nil, 0, KeywordFlag.Attack),
		},
	},
#mods

#skill SupportAdditionalLevel
#mods

#skill SupportAdditionalLevelPlus
#mods

#skill EnduranceChargeOnMeleeStun
	statMap = {
		["endurance_charge_on_melee_stun_damage_+%_final_per_endurance_charge"] = {
			mod("Damage", "MORE", nil, 0, 0, { type = "Multiplier", var = "EnduranceCharge" }),
		},
	},
#mods

#skill SupportMortalConviction
	statMap = {
		["base_skill_no_reservation"] = {
		},
	},
#baseMod skill("manaReservationFlat", 0)
#baseMod skill("lifeReservationFlat", 0)
#baseMod skill("manaReservationPercent", 0)
#baseMod skill("lifeReservationPercent", 0)
#mods

#skill SupportFirePenetration
#mods

#skill SupportFirePenetrationPlus
#mods

#skill AncestralSlamSupport
	statMap = {
		["support_ancestral_slam_big_hit_hit_damage_+%_final"] = {
			mod("FistOfWarHitMultiplier", "BASE", nil),
		},
		["support_ancestral_slam_big_hit_ailment_damage_+%_final"] = {
			mod("FistOfWarAilmentMultiplier", "BASE", nil),
		},
		["ancestral_slam_interval_duration"] = {
			mod("FistOfWarCooldown", "BASE", nil),
			div = 1000,
		},
	},
#mods

#skill SupportFlamewood
	statMap = {
		["support_flamewood_totems_trigger_infernal_bolt_when_hit"] = {
			-- Display only
		}
	},
#mods

#addSkillTypes SummonsTotem Projectile
#skill AvengingFlame
	preDamageFunc = function(activeSkill, output)
		local uuid = activeSkill.skillData.triggerSourceUUID
		local cache = uuid and (GlobalCache.cachedData["MAIN"][uuid] or GlobalCache.cachedData["CALCS"][uuid])
		local totemLife = cache and cache.Env.player.output.TotemLife or 0

		local add = totemLife * activeSkill.skillData.lifeDealtAsFire / 100
		activeSkill.skillData.FireMax = (activeSkill.skillData.FireMax or 0) + add
		activeSkill.skillData.FireMin = (activeSkill.skillData.FireMin or 0) + add
	end,
	statMap = {
		["active_skill_base_area_of_effect_radius"] = {
			skill("radius", nil),
		},
		["infernal_bolt_base_fire_damage_%_maximum_life"] = {
			skill("lifeDealtAsFire", nil),
		},
		["infernal_bolt_triggered_when_totem_with_this_skill_hit_by_enemy"] = {
			-- Display only
		}
	},
#flags area totem spell projectile
#mods

#skill SupportFortify
	statMap = {
		["support_fortify_melee_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Melee),
		},
		["support_fortify_ailment_damage_+%_final_from_melee_hits"] = {
			mod("Damage", "MORE", nil, bit.bor(ModFlag.MeleeHit, ModFlag.Ailment)),
		},
		["fortify_effect_+%"] = {
			mod("FortifyEffectOnSelf", "INC", nil)
		},
	},
#mods

#skill SupportGenerosity
	statMap = {
		["aura_cannot_affect_self"] = {
			skill("auraCannotAffectSelf", true),
		},
	},
#mods

#skill SupportGenerosityPlus
	statMap = {
		["aura_cannot_affect_self"] = {
			skill("auraCannotAffectSelf", true),
		},
	},
#mods

#skill SupportGuardiansBlessing
	statMap = {
		["aura_skill_no_reservation"] = {
		},
		["support_guardians_blessing_minion_physical_damage_%_of_maximum_life_and_ES_taken_per_minute"] = {
		},
	},
#baseMod skill("manaReservationFlat", 0, { type = "SkillType", skillType = SkillType.Aura })
#baseMod skill("lifeReservationFlat", 0, { type = "SkillType", skillType = SkillType.Aura })
#baseMod skill("manaReservationPercent", 0, { type = "SkillType", skillType = SkillType.Aura })
#baseMod skill("lifeReservationPercent", 0, { type = "SkillType", skillType = SkillType.Aura })
#mods

#skill SupportGuardiansBlessingMinion
	statMap = {
		["support_guardians_blessing_minion_physical_damage_%_of_maximum_life_and_ES_taken_per_minute"] = {
			mod("MinionModifier", "LIST", { mod = mod("PhysicalDegen", "BASE", nil, 0, 0, { type = "PercentStat", stat = "Life", percent = 1 }) }),
			mod("MinionModifier", "LIST", { mod = mod("PhysicalDegen", "BASE", nil, 0, 0, { type = "PercentStat", stat = "EnergyShield", percent = 1 }) }),
			div = 60,
		},
	},
#mods

#skill SupportIncreasedDuration
#mods

#skill SupportIronGrip
#mods

#skill SupportIronWill
#mods

#skill SupportItemQuantity
#mods

#skill SupportKnockback
#mods

#skill SupportReducedDuration
	statMap = {
		["support_reduced_duration_skill_effect_duration_+%_final"] = {
			mod("Duration", "MORE", nil),
		},
		["support_reduced_duration_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
	},
#mods

#skill SupportLifeGainOnHit
#mods

#skill SupportLifeLeech
#mods

#skill SupportLifetap
	statMap = {
		["support_lifetap_damage_+%_final_while_buffed"] = {
			mod("Damage", "MORE", nil, 0, 0, { type = "Condition", var = "Lifetap" }),
		},
	},
#mods

#skill SupportMaim
	statMap = {
		["support_maim_chance_physical_damage_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil),
		},
		["support_maimed_enemies_physical_damage_taken_+%"] = {
			mod("PhysicalDamageTaken", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Maim" }, { type = "Condition", var = "Maimed" }),
		},
	},
#mods

#skill SupportMeleePhysicalDamage
	statMap = {
		["support_melee_physical_damage_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil, ModFlag.Melee),
		},
		["support_melee_physical_damage_poison_and_bleeding_damage_+%_final_from_melee_hits"] = {
			mod("Damage", "MORE", nil, ModFlag.MeleeHit, bit.bor(KeywordFlag.Bleed, KeywordFlag.Poison)),
		},
		["support_melee_physical_damage_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, ModFlag.Attack),
		},
	},
#mods

#skill SupportMeleePhysicalDamagePlus
	statMap = {
		["support_melee_physical_damage_+%_final"] = {
			mod("PhysicalDamage", "MORE", nil, ModFlag.Melee),
		},
		["support_melee_physical_damage_poison_and_bleeding_damage_+%_final_from_melee_hits"] = {
			mod("Damage", "MORE", nil, ModFlag.MeleeHit, bit.bor(KeywordFlag.Bleed, KeywordFlag.Poison)),
		},
		["support_melee_physical_damage_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, ModFlag.Attack),
		},
	},
#mods

#skill SupportMeleeSplash
#mods

#skill SupportMeleeSplashPlus
#mods

#skill SupportMultistrike
	statMap = {
		["multistrike_damage_+%_final_on_first_repeat"] = {
			mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
			mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
		},
		["multistrike_damage_+%_final_on_second_repeat"] = {
			mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
			mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
		},
		["support_multiple_attack_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Attack),
		},
		["support_multiple_attacks_melee_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, ModFlag.Attack, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
			mod("Speed", "MORE", nil, ModFlag.Attack, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
		},
	},
#baseMod flag("SupportedByMultistrike")
#mods

#skill SupportMultistrikePlus
	statMap = {
		["multistrike_damage_+%_final_on_first_repeat"] = {
			mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
			mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
		},
		["multistrike_damage_+%_final_on_second_repeat"] = {
			mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
			mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
		},
		["multistrike_damage_+%_final_on_third_repeat"] = {
			mod("RepeatThreeDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
			mod("RepeatThreeDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
		},
		["support_multiple_attack_damage_+%_final"] = {
			mod("Damage", "MORE", nil, ModFlag.Attack),
		},
		["support_multiple_attacks_melee_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, ModFlag.Attack, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
			mod("Speed", "MORE", nil, ModFlag.Attack, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
		},
	},
#mods

#skill SupportMultiTotem
	statMap = {
		["support_additional_totem_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
	},
#mods

#skill SupportPulverise
	statMap = {
		["support_pulverise_melee_area_damage_+%_final"] = {
			mod("Damage", "MORE", nil, bit.bor(ModFlag.Melee, ModFlag.Area)),
		},
		["support_pulverise_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, ModFlag.Attack),
		},
	},
#mods

#skill SupportRage
	statMap = {
		["support_rage_gain_rage_on_melee_hit_cooldown_ms"] = {
			flag("Condition:CanGainRage", { type = "GlobalEffect", effectType = "Buff", effectName = "Rage" } ),
		},
		["attack_minimum_added_physical_damage_with_at_least_10_rage"] = {
			mod("PhysicalMin", "BASE", nil, bit.bor(ModFlag.Attack, ModFlag.Weapon), 0, { type = "MultiplierThreshold", var = "Rage", threshold = 10 })
		},
		["attack_maximum_added_physical_damage_with_at_least_10_rage"] = {
			mod("PhysicalMax", "BASE", nil, bit.bor(ModFlag.Attack, ModFlag.Weapon), 0, { type = "MultiplierThreshold", var = "Rage", threshold = 10 })
		},
		["attack_minimum_added_physical_damage_per_10_rage"] = {
			mod("PhysicalMin", "BASE", nil, bit.bor(ModFlag.Attack, ModFlag.Weapon), 0, { type = "Multiplier", var = "Rage", div = 10 })
		},
		["attack_maximum_added_physical_damage_per_10_rage"] = {
			mod("PhysicalMax", "BASE", nil, bit.bor(ModFlag.Attack, ModFlag.Weapon), 0, { type = "Multiplier", var = "Rage", div = 10 })
		},
	},
#mods

#skill SupportRangedAttackTotem
	addFlags = {
		totem = true,
		ballista = true,
	},
	statMap = {
		["support_attack_totem_attack_speed_+%_final"] = {
			mod("Speed", "MORE", nil, ModFlag.Attack),
		},
		["support_totem_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
	},
#mods

#skill SupportReducedMana
	statMap = {
		["elemental_damage_+%_final_per_righteous_charge"] = {
			mod("ElementalDamage", "MORE", nil, 0, 0, { type = "Multiplier", var = "InspirationCharge" }),
		},
		["critical_strike_chance_+%_per_righteous_charge"] = {
			mod("CritChance", "INC", nil, 0, 0, { type = "Multiplier", var = "InspirationCharge" }),
		},
	},
#mods

#skill SupportRuthless
	statMap = {
		["support_ruthless_big_hit_stun_base_duration_override_ms"] = {
			skill("baseStunDuration", nil),
			div = 1000,
		},
		["support_ruthless_big_hit_max_count"] = {
			mod("RuthlessBlowMaxCount", "BASE", nil),
		},
		["support_ruthless_big_hit_damage_+%_final"] = {
			mod("RuthlessBlowHitMultiplier", "BASE", nil, ModFlag.Melee),
		},
		["support_ruthless_blow_ailment_damage_from_melee_hits_+%_final"] = {
			mod("RuthlessBlowAilmentMultiplier", "BASE", nil, ModFlag.Melee),
		},
	},
#mods

#skill SupportBluntWeapon
	statMap = {
		["support_blunt_chance_to_trigger_shockwave_on_hit_%"] = {
		},
		["supported_skill_can_only_use_mace_and_staff"] = {
		},
	},
#mods

#skill SupportBluntWeaponShockwave
#flags attack melee area
#mods

#skill SupportSpellTotem
	addFlags = {
		totem = true,
	},
	statMap = {
		["support_spell_totem_cast_speed_+%_final"] = {
			mod("Speed", "MORE", nil, ModFlag.Cast),
		},
		["support_totem_damage_+%_final"] = {
			mod("Damage", "MORE", nil),
		},
	},
#mods

#skill SupportStun
#mods

#skill SupportTrauma
	statMap = {
		["attack_minimum_added_physical_damage_with_weapons_per_trauma"] = {
			mod("PhysicalMin", "BASE", nil, bit.bor(ModFlag.Attack, ModFlag.Weapon), 0, { type = "Multiplier", var = "TraumaStacks" })
		},
		["attack_maximum_added_physical_damage_with_weapons_per_trauma"] = {
			mod("PhysicalMax", "BASE", nil, bit.bor(ModFlag.Attack, ModFlag.Weapon), 0, { type = "Multiplier", var = "TraumaStacks" })
		},
		["support_trauma_stun_duration_+%_per_trauma"] = {
			mod("EnemyStunDuration", "INC", nil, 0, 0, { type = "Multiplier", var = "TraumaStacks" }),
		},
		["support_trauma_base_duration_ms"] = {
			mod("TraumaDuration", "BASE", nil),
			div = 1000,
		},
		["supported_skill_can_only_use_axe_mace_and_staff"] = {
		},
	},
#baseMod flag("HasTrauma")
#mods

#skill SupportUrgentOrders
#mods

#skill SupportVolatility
	statMap = {
		["minimum_attack_damage_+%_final_from_volatility_support"] = {
			mod("MinDamage", "MORE", nil),
		},
		["maximum_attack_damage_+%_final_from_volatility_support"] = {
			mod("MaxDamage", "MORE", nil),
		},
	},
#mods